Skip to content

chore: use nixpkgs master for ai tools - #774

Merged
shunkakinoki merged 7 commits into
mainfrom
chore/nixpkgs-master-ai-tools
Feb 10, 2026
Merged

chore: use nixpkgs master for ai tools#774
shunkakinoki merged 7 commits into
mainfrom
chore/nixpkgs-master-ai-tools

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Feb 10, 2026

Copy link
Copy Markdown
Owner

Changes

  • Added a nixpkgs master input
  • Override codex, claude-code, and opencode to use master
  • Updated flake lockfile

Technical Details

  • Overlay imports nixpkgs master for just the AI tools

Testing

  • Not run (nix eval only)

Generated with Codex CLI by OpenAI ChatGPT


Summary by cubic

Build codex, claude-code, and opencode from nixpkgs master via a scoped overlay; everything else stays on nixpkgs-unstable. Also added Hyprland window-swap keybindings and updated inputs/flake.lock.

  • Dependencies
    • Added nixpkgs-nightly and nixpkgs-stable; nixpkgs now follows nixpkgs-unstable.
    • Exposed nightlyPkgs in overlays and mapped codex, claude-code, and opencode to it.
    • Included code-cursor in Home Manager and in the code-syncer PATH (with vscode).

Written for commit f4715c2. Summary will update on new commits.

Copilot AI review requested due to automatic review settings February 10, 2026 07:35
@mesa-dot-dev

mesa-dot-dev Bot commented Feb 10, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the project's Nix flake configuration to leverage the latest nixpkgs master branch for specific AI-related tools. By introducing a dedicated nixpkgs-nightly input and overriding the codex, claude-code, and opencode packages, the project ensures these tools benefit from the most recent upstream changes and features. Additionally, a new package, code-cursor, was added to the home-manager setup.

Highlights

  • Nixpkgs Master Input: Introduced a new nixpkgs-nightly input to fetch packages directly from the nixpkgs master branch, ensuring access to the latest versions.
  • AI Tool Overrides: Overrode the codex, claude-code, and opencode packages to utilize the newly defined nixpkgs-nightly input, updating them to their latest master versions.
  • Flake Lockfile Update: Updated the flake.lock file to reflect the addition and locked version of the new nixpkgs-nightly input.
  • New Package Addition: Added the code-cursor package to the home-manager configuration.
Changelog
  • flake.lock
    • Added a new nixpkgs-nightly entry with its locked details.
    • Included nixpkgs-nightly in the inputs section.
  • flake.nix
    • Defined a new nixpkgs-nightly input pointing to github:NixOS/nixpkgs/master.
  • home-manager/packages/default.nix
    • Added code-cursor to the list of installed packages.
  • overlays/default.nix
    • Created a new overlay to import nixpkgs-nightly as nightlyPkgs.
    • Overrode codex, claude-code, and opencode to use their versions from nightlyPkgs.
Activity
  • The pull request was generated using OpenAI ChatGPT's Codex CLI.
  • Testing was performed via nix eval only, without full execution.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mesa-dot-dev

mesa-dot-dev Bot commented Feb 10, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Updated AI tools (codex, claude-code, opencode) to use nixpkgs master via a new flake input and overlay, and added the code-cursor package to Home Manager.

What changed?

  • flake.lock: Updated to reflect changes in dependencies, inputs, or their versions.
  • flake.nix: Added a new flake input, 'nixpkgs-nightly', pointing to the master branch of Nixpkgs.
  • home-manager/packages/default.nix: The 'code-cursor' package has been added.
  • overlays/default.nix: A new overlay introduces nightlyPkgs by importing nixpkgs-nightly and exposing codex, claude-code, and opencode from it.

Description generated by Mesa. Update settings

@coderabbitai

coderabbitai Bot commented Feb 10, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added window swapping keybindings with Vim-style (ALT+H/L/K/J) and arrow-key (ALT+SHIFT+arrows) options for easier window management
    • Added code-cursor package availability
    • Added support for nightly package variants for development tools
  • Chores

    • Updated build configuration and service setup for improved package availability

Walkthrough

Adds multiple nixpkgs inputs (stable, unstable, nightly) and makes nixpkgs follow unstable; exposes nightly packages via overlays; adds code-cursor to home-manager packages; adds Hyprland window-swap keybindings; embeds Serena config via readFile; extends code-syncer PATH; reformats renovate.json.

Changes

Cohort / File(s) Summary
Flake inputs
flake.nix
Replaced previous inline nixpkgs with multiple inputs: nixpkgs-stable, nixpkgs-unstable, nixpkgs-nightly; added nixpkgs alias that follows = "nixpkgs-unstable".
Overlays / nightly exports
overlays/default.nix
Added final: prev: block that imports inputs.nixpkgs-nightly as nightlyPkgs and exposes codex, claude-code, opencode as top-level aliases.
Home-manager packages
home-manager/packages/default.nix
Added code-cursor to main package list and to the Linux desktop optional packages list.
Hyprland config
config/hyprland/hyprland.conf
Added new window-swap keybindings (mod+Alt+H/L/K/J and mod+Alt+Shift+arrow keys) mapped to swapwindow.
Serena config embedding
config/serena/default.nix
Changed serena config provisioning to embed file contents via builtins.readFile instead of referencing the source path.
Service PATHs
home-manager/services/code-syncer/default.nix
Added pkgs.code-cursor and pkgs.vscode into the service PATHs (Environment PATH and ExecStart binPath).
Repo tooling
renovate.json
Reformatted repositories array from single-line to multi-line (formatting-only change).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

🐰 I hopped in late to fetch the night,
Three nixpkgs stars to make things right.
Codex, cursor, keys that swap and slide,
Configs tucked in, the overlays glide.
A carrot cheer for builds worldwide! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: using nixpkgs master for AI tools (codex, claude-code, opencode).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The description clearly relates to the changeset, detailing the addition of nixpkgs master input, override of AI tools, and flake.lock updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/nixpkgs-master-ai-tools

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to use nixpkgs/master for certain AI tools by adding a new flake input and an overlay. However, this introduces a medium-severity supply chain risk, as the master branch is not a stable, immutable source, and a security vulnerability has been identified. Additionally, a critical issue causing build failures on Linux due to unwhitelisted unfree packages needs to be addressed, and the new overlay requires refactoring for better code style and consistency.

Comment thread overlays/default.nix
Comment on lines +41 to +43
codex = final.nightlyPkgs.codex;
claude-code = final.nightlyPkgs.claude-code;
opencode = final.nightlyPkgs.opencode;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The packages codex and opencode are marked as unfree in nixpkgs. The build will fail on Linux systems because they are not included in the allowUnfreePredicate in lib/nixpkgs-config.nix. Please add them to the list of allowed unfree packages to prevent build failures.

Comment thread flake.nix
Comment on lines +8 to +10
nixpkgs-nightly = {
url = "github:NixOS/nixpkgs/master";
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

The configuration fetches nixpkgs-nightly directly from the master branch. The master branch is a development branch and can receive frequent, less-vetted updates, including potentially vulnerable or unstable code. While Nix flakes pin dependencies in flake.lock, an update to the flake's inputs will pull the latest commit from master, which could introduce untrusted code. This practice increases the risk of supply chain attacks compared to using tagged releases or more stable channels.

Recommendation: For better security and stability, pin the dependency to a specific, immutable git revision (a commit hash or tag) instead of a floating branch like master. This ensures that you are always using a known, vetted version of the dependency.

Comment thread overlays/default.nix
Comment on lines +35 to +44
(final: prev: {
nightlyPkgs = import inputs.nixpkgs-nightly {
system = prev.system;
config = prev.config;
overlays = [ ];
};
codex = final.nightlyPkgs.codex;
claude-code = final.nightlyPkgs.claude-code;
opencode = final.nightlyPkgs.opencode;
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This overlay implementation adds nightlyPkgs to the global pkgs namespace, which is likely unintended. Using a let block would make the overlay cleaner and prevent polluting the package set.

Additionally, for consistency with the PR's goal of using nixpkgs-master for AI tools, you should consider also overriding code-cursor (which was added in this PR) to use the version from nixpkgs-nightly.

  (final: prev:
    let
      nightlyPkgs = import inputs.nixpkgs-nightly {
        system = prev.system;
        config = prev.config;
        overlays = [ ];
      };
    in {
      codex = nightlyPkgs.codex;
      claude-code = nightlyPkgs.claude-code;
      opencode = nightlyPkgs.opencode;
      code-cursor = nightlyPkgs.code-cursor;
    })

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a second nixpkgs input pinned to the master branch and uses it to override a small set of AI tooling packages, aiming to pull newer versions for those tools without moving the rest of the system off nixpkgs-unstable.

Changes:

  • Add a nixpkgs-nightly flake input pointing at NixOS/nixpkgs master.
  • Import nixpkgs-nightly in the overlay and override codex, claude-code, and opencode from it.
  • Add code-cursor to the desktop Linux home-manager package list and update flake.lock.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
overlays/default.nix Imports nixpkgs-nightly and overrides select AI tools from that package set.
home-manager/packages/default.nix Adds code-cursor to the Linux desktop package set.
flake.nix Declares the new nixpkgs-nightly input.
flake.lock Pins the new nixpkgs-nightly input revision/hash and wires it into the lock graph.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread overlays/default.nix
Comment on lines +35 to +44
(final: prev: {
nightlyPkgs = import inputs.nixpkgs-nightly {
system = prev.system;
config = prev.config;
overlays = [ ];
};
codex = final.nightlyPkgs.codex;
claude-code = final.nightlyPkgs.claude-code;
opencode = final.nightlyPkgs.opencode;
})

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overlay exports nightlyPkgs into pkgs and then references it via final.nightlyPkgs.*. If the intent is only to override a few packages, consider keeping the imported nixpkgs set as a local let nightlyPkgs = ...; in { ... } binding and referencing nightlyPkgs.<pkg> directly. This avoids adding a new top-level pkgs.nightlyPkgs attribute (API surface) and reduces coupling to overlay evaluation order (e.g., relying on prev.system).

Suggested change
(final: prev: {
nightlyPkgs = import inputs.nixpkgs-nightly {
system = prev.system;
config = prev.config;
overlays = [ ];
};
codex = final.nightlyPkgs.codex;
claude-code = final.nightlyPkgs.claude-code;
opencode = final.nightlyPkgs.opencode;
})
(final: prev:
let
nightlyPkgs = import inputs.nixpkgs-nightly {
system = prev.system;
config = prev.config;
overlays = [ ];
};
in {
codex = nightlyPkgs.codex;
claude-code = nightlyPkgs.claude-code;
opencode = nightlyPkgs.opencode;
})

Copilot uses AI. Check for mistakes.
chromium
clickup
cliphist
code-cursor

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code-cursor is only included when (stdenv.isLinux && isDesktop) is true, but the repo’s eval checks appear to run with inputs.host.isDesktop = false by default (lib/host.nix), so this addition likely isn’t exercised by nix flake check. Consider extending the evaluation checks (or adding a desktop test config) so the desktop-only package set is evaluated and failures like missing/renamed attributes are caught in CI.

Copilot uses AI. Check for mistakes.
@shunkakinoki
shunkakinoki merged commit 7cd600e into main Feb 10, 2026
24 of 26 checks passed
@shunkakinoki
shunkakinoki deleted the chore/nixpkgs-master-ai-tools branch February 10, 2026 08:06
@coderabbitai coderabbitai Bot mentioned this pull request May 11, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants